/**
 * This class contains set of utility functions useful in general.
 */
package tools;

/**
 * @author Vivek
 *
 */
public class UtilFunctions {

    /* 
     * This function us used to display array for diagnostics
     * (non-Javadoc)
     * @see neuralnetwork.ModifiedBackPropagation#displayError(double[])
     */
    public static void displayArray(double[] outputError,String comment){
    	System.out.println(comment);
    	for(int n=0;n < outputError.length;n++){
			System.out.println(outputError[n]);
		}
	}

    /* 
     * This function us used to return String for 2D array
     * (non-Javadoc)
     * @see neuralnetwork.ModifiedBackPropagation#displayError(double[])
     */
    public static String displayArray(int[] outputError){
		String mag = "";
		mag += "[";    	
    	for(int n=0;n < outputError.length;n++){
			mag += outputError[n]+",";
    	}
    	return mag += "]";
	}
	
	public static String display2DArray(double[][] coef){
		String mag = "";
//		System.out.print(msg+",");
		
		mag += "[";
		for (int n = 0;n < coef.length;n++){
			int l;
			mag += "[";
			for(l = 0;l < coef[n].length-1;l++ ){
				mag += coef[n][l]+",";
			}
			mag += coef[n][l]+"]";
		}
		return mag += "]";
	}

}
